Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add topological_sort() to datanames(teal_data()) and also extend datanames() with parent dataset when it is provided in join_keys #319

Merged
merged 35 commits into from
Aug 12, 2024

Conversation

m7pr
Copy link
Contributor

@m7pr m7pr commented Jul 31, 2024

Part of insightsengineering/teal#1253

This PR introduced below changes

  • teal_data() constructor does not put names(join_keys) in default datanames(teal_data()) to maintain consistency with other features, where we do not allow datanames() to contain names of objects that do not exist in @env
  • datanames() now sorts names topologically based on provided join_keys()
  • each time datanames() and join_keys() is overwritten the sort is applied to teal_data()@datanames
  • provided few more tests
  • adjusted 2 tests that assumed extraction of datanames() from join_keys is fine - but it's not right now as we do not allow datanames() to contain names of objects that do not exists in @env

Will provide testing in this PR in teal as well https://github.com/insightsengineering/teal/pull/1280/files

m7pr and others added 26 commits January 18, 2024 11:54
Merge branch 'main' of https://github.com/insightsengineering/teal.data

# Conflicts:
#	tests/testthat/test-get_code.R
Update R/teal_data-datanames.R

Signed-off-by: Marcin <[email protected]>
add two tests for topological_sort
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: Marcin <[email protected]>
…in_keys as they might refer to datanames that do not exist in env
@m7pr m7pr added the core label Jul 31, 2024
Copy link
Contributor

github-actions bot commented Jul 31, 2024

✅ All contributors have signed the CLA
Posted by the CLA Assistant Lite bot.

@m7pr
Copy link
Contributor Author

m7pr commented Jul 31, 2024

I have read the CLA Document and I hereby sign the CLA

@m7pr
Copy link
Contributor Author

m7pr commented Jul 31, 2024

recheck

@gogonzo
Copy link
Contributor

gogonzo commented Jul 31, 2024

I have read the CLA Document and I hereby sign the CLA

Copy link
Contributor

github-actions bot commented Jul 31, 2024

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  --------------------
R/cdisc_data.R                       1       0  100.00%
R/deprecated.R                      57      57  0.00%    19-344
R/dummy_function.R                   2       2  0.00%    14-15
R/formatters_var_labels.R           61       0  100.00%
R/join_key.R                        38       0  100.00%
R/join_keys-c.R                     12       0  100.00%
R/join_keys-extract.R              128       0  100.00%
R/join_keys-names.R                 15       0  100.00%
R/join_keys-parents.R               30       0  100.00%
R/join_keys-print.R                 45       0  100.00%
R/join_keys-utils.R                 73       3  95.89%   35-38
R/join_keys.R                       22       0  100.00%
R/teal_data-class.R                 26       1  96.15%   69
R/teal_data-datanames.R             20       0  100.00%
R/teal_data-get_code.R              14       0  100.00%
R/teal_data-show.R                   4       4  0.00%    14-19
R/teal_data.R                       30      16  46.67%   33, 36-42, 52-58, 61
R/testhat-helpers.R                 26       0  100.00%
R/topological_sort.R                32       0  100.00%
R/utils-get_code_dependency.R      187       1  99.47%   282
R/verify.R                          42      11  73.81%   65, 95-99, 102-106
TOTAL                              865      95  89.02%

Diff against main

Filename                   Stmts    Miss  Cover
-----------------------  -------  ------  --------
R/join_keys.R                 +1       0  +100.00%
R/teal_data-class.R           +1       0  +0.15%
R/teal_data-datanames.R      +10       0  +100.00%
TOTAL                        +12       0  +0.15%

Results for commit: 56fc828

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Jul 31, 2024

Unit Tests Summary

  1 files   14 suites   2s ⏱️
203 tests 201 ✅ 2 💤 0 ❌
276 runs  274 ✅ 2 💤 0 ❌

Results for commit 56fc828.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jul 31, 2024

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
datanames 👶 $+0.00$ datanames_are_set_in_topological_order_in_constructor_if_join_keys_are_specified
datanames 👶 $+0.00$ datanames_do_not_return_parent_if_in_constructor_it_was_provided_in_join_keys_but_do_not_exists_in_env
datanames 👶 $+0.01$ datanames_do_not_return_parent_if_join_keys_were_provided_and_parent_did_not_exists_in_env
datanames 👶 $+0.01$ datanames_return_parent_if_in_constructor_it_was_provided_in_join_keys_and_exists_in_env
datanames 👶 $+0.01$ datanames_return_parent_if_join_keys_were_provided_and_parent_exists_in_env
datanames 👶 $+0.01$ datanames_return_topological_order_of_datasets_after_datanames_are_called_after_join_keys
datanames 👶 $+0.01$ datanames_return_topological_order_of_datasets_once_join_keys_are_specified
teal_data 💀 $0.00$ $-0.00$ teal_data_initializes_teal_data_object_with_datanames_taken_from_join_keys_and_passed_objects
teal_data 💀 $0.00$ $-0.00$ teal_data_initializes_teal_data_object_with_datanames_taken_from_passed_join_keys
teal_data 👶 $+0.00$ teal_data_initializes_teal_data_object_with_datanames_taken_only_from_passed_objects_and_not_join_keys
teal_data 👶 $+0.00$ teal_data_initializes_teal_data_object_without_datanames_taken_from_join_keys_if_objects_did_not_exist_in_env

Results for commit 7b68a03

♻️ This comment has been updated with latest results.

@gogonzo
Copy link
Contributor

gogonzo commented Jul 31, 2024

@m7pr please add a NEWS entry and fix GHA checks

@m7pr
Copy link
Contributor Author

m7pr commented Aug 1, 2024

Hey @gogonzo NEWS enhanced! that was a long one.
Fixed lintr and spelling checks as well!

@gogonzo
Copy link
Contributor

gogonzo commented Aug 1, 2024

👍

@m7pr m7pr merged commit d240c22 into main Aug 12, 2024
28 checks passed
@m7pr m7pr deleted the 669_insertUI@main branch August 12, 2024 11:34
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants